package com.example.teacherservice.config;

import com.example.teacherservice.repository.CourseRepository;
import com.example.teacherservice.repository.StuCourseRepository;
import com.example.teacherservice.repository.StudentRepository;
import com.example.teacherservice.service.StudentCourseService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ServiceConfig {

    @Bean
    public StudentCourseService studentCourseService(
            StuCourseRepository stuCourseRepository,
            CourseRepository courseRepository,
            StudentRepository studentRepository
    ) {
        return new StudentCourseService() {
            @Override
            public StuCourseRepository getStuCourseRepository() {
                return stuCourseRepository;
            }

            @Override
            public CourseRepository getCourseRepository() {
                return courseRepository;
            }

        };
    }
}